<template>
  <div class="margin-bottom-20">
    <template v-if="planTypeList.length > 0">
      <div v-for="(item, index) in planTypeList" :key="index">
        <div class="align-center padding-bottom-15 padding-right-20">
          <span class="padding-right-20 font-size-18 font-weight-700">{{ item.name }}</span>
          <el-button v-if="item.isAdd && (!contractInfo.contractStatus || $route.query.isAgreement)" type="text" @click="addOtherItem(item)">添加</el-button>
          <el-button v-if="item.isTier && (!contractInfo.contractStatus || $route.query.isAgreement)" type="text" @click="addTierItem(item, item.filedListName)">添加</el-button>
        </div>
        <template v-if="item.isAdd">
          <div class="full-box padding-bottom-10" :class="formIndex < item.list.length - 1 ? 'border-bottom-F2F2F2 margin-bottom-20' : ''" v-for="(formItem, formIndex) in item.list" :key="formItem.id">
            <form-common class="padding-right-20" :filed-list="formItem.listName" :ref="item.formRefName + [formIndex]" @selectChange="selectChange"> </form-common>
            <div class="full-box btn-box">
              <el-button v-if="!contractInfo.contractStatus || $route.query.isAgreement" class="f-right padding-top-0 color-red margin-right-20" type="text" @click="deleteOtherItem(item.list, formIndex)">删除</el-button>
            </div>
          </div>
        </template>

        <template v-if="item.isTier">
          <div class="full-box padding-bottom-10" :class="formIndex < item.list.length - 1 ? 'border-bottom-thick-F2F2F2 margin-bottom-20' : ''" v-for="(formItem, formIndex) in item.list" :key="formItem.id">
            <form-common class="padding-right-20" :filed-list="formItem.filedList" :ref="item.formRefName + [formIndex]" @selectChange="selectChange"> </form-common>
            <div class="full-box btn-box">
              <el-button v-if="!contractInfo.contractStatus || $route.query.isAgreement" class="f-right padding-top-0 color-red margin-right-20" type="text" @click="deleteOtherItem(item.list, formIndex)">删除</el-button>
            </div>

            <div class="align-center padding-bottom-15">
              <span class="padding-right-20 font-size-16 font-weight-700">{{ item.sonName }}</span>
              <el-button v-if="item.sonIsAdd && (!contractInfo.contractStatus || $route.query.isAgreement)" type="text" @click="addTierItem(formItem, item.sonFiledListName)">添加</el-button>
            </div>
            <div class="full-box padding-bottom-10" v-for="(sonItem, sonIndex) in formItem.list" :key="sonItem.id">
              <form-common class="padding-right-20" :filed-list="sonItem.filedList" :ref="item.formRefName + 'son' + [formIndex] + [sonIndex]" @selectChange="selectChange"> </form-common>
              <div class="full-box btn-box">
                <el-button v-if="!contractInfo.contractStatus || $route.query.isAgreement" class="f-right padding-top-0 color-red margin-right-20" type="text" @click="deleteOtherItem(formItem.list, sonIndex)">删除</el-button>
              </div>
            </div>
          </div>
        </template>

        <template v-if="!item.isAdd && !item.isTier">
          <form-common v-if="item.filedList.length > 0" class="padding-right-20" :filed-list="item.filedList" :ref="item.formRefName" @selectChange="selectChange"> </form-common>
        </template>

        <!-- 有特殊情况的表单或者外部内容 -->
        <!-- <p class="padding-left-right-20" style="width: 100%">该设备保质期<span class="color-red">于6月12日到期</span></p>
        <div class="align-center padding-left-right-20 margin-top-15">
          <span style="width: 150px">说明</span>
          <el-input class="bg-gray-input" placeholder="请输入" v-model="shuoming"></el-input>
        </div> -->
      </div>
    </template>
    <el-empty v-else description="暂无信息"></el-empty>
  </div>
</template>
<script>
  import { apiMenuSonList } from '../../../api/common';
  import formCommon from '@g/components/form/formCommon.vue';
  import * as Plan from './financePlan.js';
  import * as Form from '@/pages/businessAssets/config/contractForm';
  import { DASE_INFO, LEASE_INFO, GATHERING_PLAN, OTHER_INFO, PAY_PLAN, PARKING_INFO, ADVERTISING_INFO, ASSET_INFO, LEASE_COST } from '@/pages/businessAssets/config';
  import { apiShopList, apiParkList, apiAdvertList, apiPaysonList, apiAreaList, apiActivitySpaceList, listByMapBizId, categoryList } from '../../../api/contract';
  import { guid,formDataDate } from '@/common/js/utils';
  import bus from "../../../mixin/bus";

  export default {
    props: {
      //基本信息中选择的项目key
      choseProjectKey: {
        type: String,
        default: '',
      },
      //基本信息中选择的开始时间
      choseBeginDate: {
        type: Number,
        default: '',
      },
      //基本信息中选择的结束时间
      choseEndDate: {
        type: Number,
        default: '',
      },
      contractType: {
        type: String,
        default: '',
      },
      //是否是详情
      isInfo: {
        type: String,
        default: '',
      },
      isFirst: {
        type: Boolean,
        default: true,
      },
      contractInfo: {
        type: Object,
        default: () => {
          return {};
        },
      },
      dictoryList: {
        type: Array,
        default: () => {
          return [];
        },
      },
    },

    watch: {
      contractInfo: {
        immediate: true,
        deep: true,
        handler(obj) {
          let newObj = JSON.parse(JSON.stringify(obj));
          if (obj.enterpriseid && this.isFirst && obj.contractRentInfo && obj.contractRentInfo.industryType) {
            this.getListByMapBizId(obj.contractRentInfo.industryType);
          }
          if (this.isInfo && this.planTypeList.length > 0 && newObj.orgKey && this.isFirst) {
            this.initSelectData(newObj);
          }
        },
      },
      dictoryList: {
        immediate: true,
        deep: true,
        handler(obj) {
          this.initSelectOptionList(obj);
        },
      },
      choseProjectKey: {
        handler(val) {
          this.currentProjectKey = val;
          if (this.contractType == 'LSCD') {
            this.planTypeList[0].list = [];
          }
        },
      },
      choseBeginDate: {
        deep: true,
        handler(val) {
          this.currentContractBeginDate = val;
        },
      },
      choseEndDate: {
        deep: true,
        handler(val) {
          this.currentContractEndDate = val;
        },
      },
    },

    // 字段集中的canEmpty为true时，校验有添加按钮的时候是否为空，必须加一个
    data() {
      return {
        leasePlanFiledList: [], //租赁信息
        gatheringPlanFiledList: [], //收款计划
        shuoming: '',
        planTypeList: [],
        currentProjectKey: '',
        currentContractBeginDate: '',
        currentContractEndDate: '',
        enterpriseid: localStorage.getItem('userEnterpriseid'),
      };
    },

    created() {
      this.initType();
      this.getListByMapBizId();
      //不是详情时
      if (!this.isInfo) {
        this.planTypeList.forEach(listItem => {
          if (!listItem.isAdd) {
            listItem.filedList = Plan[listItem.filedListName];
          }
        });
      }
    },

    methods: {
      //项目变化的二级联动Fn + 初始化页面数据
      async initSelectData(newObj) {
        this.currentProjectKey = newObj.projectKey;
        //停车场合同（停车位）、广告合同（广告）的下拉框选择入参需要开始时间结束时间，这里是详情页面的初始化这俩时间
        this.currentContractBeginDate = newObj.contractBeginDate;
        this.currentContractEndDate = newObj.contractEndDate;
        let [shop, park, ad, pay, gather, adcharge, area] = await Promise.all([this.getParkListFn(), this.getAdvertListFn(), this.getChargeItemList(), this.getAreaListFn()]);
        this.initBaseInfo(newObj);
        //临时场地合同的活动空间下拉框数据回显
        if (this.contractType == 'LSCD') {
          this.getSpaceList(newObj.projectKey);
        }
      },

      //信息回显 obj后端返回的详情（从最外层开始到内的数据）
      initBaseInfo(obj) {
        this.planTypeList.forEach(listItem => {
          //没有添加功能的表单
          if (listItem.isTier) {
            this.initInfoTierList(obj[listItem.bindBackName], listItem);
          } else if (listItem.isAdd) {
            this.initInfoAddList(obj[listItem.bindBackName], listItem);
          } else {
            // this.$refs[listItem.formRefName] && this.$refs[listItem.formRefName][0].initModel()
            let list = Plan[listItem.filedListName]; //自己定义的表单字段list
            if (!this.$route.query.isAgreement && obj.contractStatus && obj.contractStatus != 3) {
              this.initFormReadOnly(list);
            }
            list.forEach(item => {
              //obj[listItem.bindBackName]：后端返回的详情内的对应的详情
              for (let i in obj[listItem.bindBackName]) {
                //比对自己定义的bindFieldName和后端返回的详情内的字段，相等则进行赋值
                if (item.bindFieldName == i) {
                  item.bindFieldVal = obj[listItem.bindBackName][i];
                }
              }
            });
            listItem.filedList = list;
          }
        });
      },

      //信息回显 有添加功能的表单. list:后端返回的数据list; listItem：本页面应该展示的表单种类（每一个）
      initInfoAddList(list, listItem) {
        listItem.list = [];
        list.forEach(item => {
          let oldList = JSON.parse(JSON.stringify(Plan[listItem.filedListName]));
          if (!this.$route.query.isAgreement && this.contractInfo.contractStatus && this.contractInfo.contractStatus != 3) {
            this.initFormReadOnly(oldList);
          }
          this.setFiledVal(oldList, item);
          listItem.list.push({
            id: guid(),
            listName: oldList,
          });
        });
      },

      //信息回显 有添加功能多层的表单. list:后端返回的数据list; listItem：本页面应该展示的表单种类（每一个）
      initInfoTierList(list, listItem) {
        listItem.list = [];
        list.forEach(item => {
          let sonList = []; //子集（收款计划）的字段集合
          let oldList = JSON.parse(JSON.stringify(Plan[listItem.filedListName]));
          if (!this.$route.query.isAgreement && this.contractInfo.contractStatus && this.contractInfo.contractStatus != 3) {
            this.initFormReadOnly(oldList);
          }
          this.setFiledVal(oldList, item);
          //赋值子集的回显
          item[listItem.sonBindBackName].forEach(sonItem => {
            let sonFieldList = JSON.parse(JSON.stringify(Plan[listItem.sonFiledListName]));
            if (!this.$route.query.isAgreement && this.contractInfo.contractStatus && this.contractInfo.contractStatus != 3) {
              this.initFormReadOnly(sonFieldList);
            }
            this.setFiledVal(sonFieldList, sonItem);
            sonList.push({
              filedList: sonFieldList,
            });
          });
          listItem.list.push({
            filedList: oldList,
            list: sonList,
            id: guid(),
          });
        });
      },

      //字段回显
      setFiledVal(list, row) {
        list.forEach(item => {
          for (let i in row) {
            if (i == item.bindFieldName) {
              if (typeof row[i] === 'number' && !isNaN(row[i])) {
                row[i] = String(row[i]);
              }
              item.bindFieldVal = row[i];
            }
          }
        });
      },

      //添加单层块信息
      addOtherItem(row, isTier, listName) {
        if (!this.currentProjectKey) {
          this.$message.warning('请先选择项目');
          return;
        }
        //租赁合同的租赁成本需要深拷贝,因为里面的选择赠送有二级联动，浅拷贝会导致所有的二级联动下拉框全是相同数据源
        let list = [];
        if (row.bindBackName == 'rentCostList' && this.contractType == 'ZL') {
          list = JSON.parse(JSON.stringify(Plan[row.filedListName]));
        } else {
          list = Plan[row.filedListName];
        }
        row.list.push({
          id: guid(),
          listName: list,
        });
      },

      //添加多层块信息
      addTierItem(row, listName) {
        if (!this.currentProjectKey) {
          this.$message.warning('请先选择项目');
          return;
        }
        //临时场地的财务与计划需要深拷贝,因为里面的活动空间有二级联动，浅拷贝会导致所有的二级联动下拉框全是相同数据源
        let list = [];
        if (row.bindBackName == 'rentAssetsList' && this.contractType == 'LSCD') {
          list = JSON.parse(JSON.stringify(Plan[listName]));
        } else {
          list = Plan[listName];
        }
        row.list.push({
          filedList: list,
          id: guid(),
          list: [],
        });
      },

      //删除块信息
      deleteOtherItem(typeListName, index) {
        typeListName.splice(index, 1);
      },

      //保存
      saveFn(type) {
        let formAllModle = {}; //本组件页面的所有表单域值的集合,key为planTypeList集合的formRefName字段,标题的字面意思
        this.planTypeList.forEach(item => {
          formAllModle[item.bindBackName] = item.isAdd || item.isTier ? [] : {};
        });

        //组装给后端的数据
        this.planTypeList.forEach((item, index) => {
          let formName = '';
          //如果isAdd为true，说明form表单域是有添加按钮的，反出去list
          if (item.isAdd) {
            item.list.forEach((con, conIndex) => {
              formName = item.formRefName + conIndex; //找到form的ref名字
              let model = type == 'audit' ? this.$refs[formName][0].validateForm() : this.$refs[formName][0].returnModel();
              //更新时需要
              if (this.$route.query.isInfo && model) {
                model.contractKey = this.$route.query.contractKey;
              }
              //外部的表单把值给进去
              // if (model !== false) {
              //   model.shuoming = this.shuoming;
              // }
              formAllModle[item.bindBackName].push(model);
            });
          } else if (item.isTier) {
            item.list.forEach((con, conIndex) => {
              formName = item.formRefName + conIndex; //找到form的ref名字
              let model = type == 'audit' ? this.$refs[formName][0].validateForm() : this.$refs[formName][0].returnModel();
              if (model) {
                model[item.sonBindBackName] = [];
              }

              //更新时需要
              if (this.$route.query.isInfo) {
                model.contractKey = this.$route.query.contractKey;
              }
              con.list.forEach((son, sonIndex) => {
                let sonFormName = item.formRefName + 'son' + conIndex + sonIndex;
                let sonModel = type == 'audit' ? this.$refs[sonFormName][0].validateForm() : this.$refs[sonFormName][0].returnModel();
                if (this.$route.query.isInfo) {
                  sonModel.contractKey = this.$route.query.contractKey;
                }
                if (model) {
                  model[item.sonBindBackName].push(sonModel);
                }
              });

              formAllModle[item.bindBackName].push(model);
            });
          } else {
            formName = item.formRefName; //找到form的ref名字
            formAllModle[item.bindBackName] = type == 'audit' ? this.$refs[formName][0].validateForm() : this.$refs[formName][0].returnModel();
            //租赁合同编辑的时候要把contractRentInfo.primaryKey带回去
            if (this.contractType == 'ZL' && formAllModle[item.bindBackName] && item.bindBackName == 'contractRentInfo' && (!this.contractInfo.contractStatus || this.contractInfo.contractStatus == 3) && this.$route.query.isInfo) {
              formAllModle[item.bindBackName].primaryKey = this.contractInfo.contractRentInfo.primaryKey;
            }
          }
        });

        //校验有添加按钮的是否为空
        if (type == 'audit') {
          for (let i in formAllModle) {
            if (Array.isArray(formAllModle[i]) && formAllModle[i].indexOf(false) > -1) {
              formAllModle[i] = false;
            }

            for (let j in this.planTypeList) {
              let item = this.planTypeList[j];
              //两层添加按钮的情况下 isTier==true
              if (i == item.bindBackName && item.isTier && formAllModle[i]) {
                formAllModle[i].forEach((sonItem, sonIndex) => {
                  if ((sonItem && sonItem[item.sonBindBackName].length == 0) || sonItem[item.sonBindBackName].indexOf(false) > -1) {
                    if (sonItem[item.sonBindBackName].length == 0) {
                      this.$message.warning('请添加第' + (sonIndex + 1) + '个' + item.name.substring(0, item.name.length - 1) + '的' + item.sonName.substring(0, item.sonName.length - 1));
                    }
                    formAllModle[i] = false;
                  }
                });
              }
              //单层，外层: canEmpty为true时，校验有添加按钮的时候是否为空，必须加一个
              if (item.canEmpty && Array.isArray(formAllModle[i]) && formAllModle[i].length == 0 && i == item.bindBackName) {
                this.$message.warning('请添加' + item.name.substring(0, item.name.length - 1));
                return false;
              }
            }
          }
        }

        //校验后空值或者没填过的返回给父组件false，禁止提交
        let returnModel = JSON.parse(JSON.stringify(formAllModle));
        for (let i in formAllModle) {
          if (formAllModle[i] === false) {
            returnModel = false;
          }
        }
        if (!returnModel) {
          this.$message.warning('请检查必填项!');
        }
        return returnModel;
      },

      //初始化类型，展示相应的表单
      initType() {
        if (this.contractType == 'ZL') {
          this.planTypeList = Form.leasePlanTypeList;
        } else if (this.contractType == 'GGZL') {
          this.planTypeList = Form.advertisingPlanTypeList;
        } else if (this.contractType == 'LSCD') {
          this.planTypeList = Form.lscdPlanTypeList;
        } else if (this.contractType == 'WRSB') {
          this.planTypeList = Form.wrsblanTypeList;
        } else if (this.contractType == 'TCCYY') {
          this.planTypeList = Form.tccPlanTypeList;
        } else if (this.contractType == 'QTSR') {
          this.planTypeList = Form.qthtPlanTypeList;
        } else if (this.contractType == 'ZX' || this.contractType == 'GC' || this.contractType == 'TG' || this.contractType == 'XZ' || this.contractType == 'CW' || this.contractType == 'YY') {
          this.planTypeList = Form.fkhtPlanTypeList;
        }
      },

      //初始化filed只读
      initFormReadOnly(list) {
        list.forEach(item => {
          item.isReadOnly = true;
          item.isRequired = false;
          if (item.type == 'select' || item.type == 'date' || item.type == 'radio' || item.type == 'checkbox') {
            item.isDisabled = true;
          }
        });
      },

      //页面表单的动作,data.filedName判断是具体哪一项为触发点
      async selectChange(data) {
        let projectKey = this.currentProjectKey || this.contractInfo.projectKey;
        //选择收付费项要把Name传给后台
        if (data.filedName == 'chargeItemKey') {
          data.formItem.optionList.forEach(filed => {
            if (filed.primaryKey == data.filedVal) {
              data.cb('chargeItemName', filed.chargeItemName);
            }
          });
        }
        //选择广告位要把adType传给后台
        if (data.filedName == 'adKey') {
          data.formItem.optionList.forEach(filed => {
            if (filed.primaryKey == data.filedVal) {
              data.cb('adType', filed.adType);
            }
          });
        }
        //临时场地合同的区域选择级连活动空间
        if (data.filedName == 'rentArea') {
          let res = await apiActivitySpaceList({ projectKey: projectKey, spacePartitionKey: data.filedVal });
          data.cbList('venueKey', res.rows);
        }
        //获取品牌
        if (data.filedName == 'industryType') {
          let parentId = '';
          data.formItem.optionList.forEach(filed => {
            if (filed.primaryKey == data.filedVal) {
              parentId = filed.parentId;
            }
          });
          this.getOperateBrand(parentId);
        }
        //无人设备-经营信息-数量字段
        if (data.filedName == 'deviceNum') {
          this.$emit('setDeviceNum', data.filedVal);
        }
        //租赁合同-经营信息-租金模式
        if (data.filedName == 'rentMode' && this.contractType == 'ZL') {
          this.$emit('setRentMode', data.filedVal);
        }
        //经营品牌
        if (data.filedName == 'operateBrand') {
          let operateBrandName = '';
          data.formItem.optionList.forEach(filed => {
            if (filed.primaryKey == data.filedVal) {
              operateBrandName = filed.catalogName;
            }
          });
          console.log(this.Bus)
          bus.$emit('operateBrandName', operateBrandName)
        }
        //商铺名称
        if (data.filedName == 'leaserShopName') {
          console.log(this.Bus)
          bus.$emit('leaserShopName', data.filedVal)
        }
      },

      // --------------------------------------------------------------以下都是页面下拉框的常量值数据源---------------------------------------------------------

      //初始化下拉框的option
      initSelectOptionList(obj) {
        let listName = ['leaseBasePlanFiledList', 'lscdLeasePlanFiledList', 'lscdGatheringPlanFiledList', 'qtsrOtherPlanFiledList', 'qtsrPayPlanFiledList', 'tccdyyOtherPlanFiledList', 'tccdyyGatheringPlanFiledList', 'zchtPlanFiledList', 'ggwxxPlanFiledList', 'leaseBasePlanFiledList', 'ggwxxGatherFiledList'];
        listName.forEach(l => {
          Plan[l].forEach(item => {
            obj.forEach(dic => {
              if (item.bindFieldName != 'giveAwayItem') {
                if (item.bindFieldName == dic.dictType) {
                  item.optionList = dic.dictList;
                }
              }

              if ((item.bindFieldName == 'rentCollectionCycle' || item.bindFieldName == 'managementFeeCycle') && dic.dictType == 'rentCollectionCycle') {
                item.optionList = dic.dictList;
              }
            });
          });
        });
      },

      //业态/行业类型 industryTypeId：经营品牌的key
      async getListByMapBizId(industryTypeId) {
        let res = await listByMapBizId({
          bizId: 'commercial_rent_main_data',
          catalogTypeList: ['business_type_child'],
          mapBizId: this.contractInfo.enterpriseid || this.enterpriseid, //企业id
        });
        Plan['leaseBasePlanFiledList'].forEach(ele => {
          if (ele.bindFieldName == 'industryType') {
            ele.optionList = res.rows;
          }
        });
        let parentId = '';
        res.rows.forEach(filed => {
          if (filed.primaryKey == industryTypeId) {
            parentId = filed.parentId;
          }
        });
        //反显经营品牌
        if (industryTypeId) {
          this.getOperateBrand(parentId);
        }
      },

      //获取品牌 - 常量；
      async getOperateBrand(parentId) {
        let res = await categoryList({
          parentId: parentId,
          catalogTypeList: ['brand_child'],
        });
        Plan['leaseBasePlanFiledList'].forEach(ele => {
          if (ele.bindFieldName == 'operateBrand') {
            ele.optionList = res.rows;
          }
        });
      },

      //停车场信息 - 常量；
      async getParkListFn() {
        return new Promise(async (resolve, reject) => {
          let res = await apiParkList({ projectKey: this.currentProjectKey, startDate: this.currentContractBeginDate, endDate: this.currentContractEndDate });
          Plan.tccdyyOtherPlanFiledList.forEach(item => {
            if (item.bindFieldName == 'carParkKey') {
              item.optionList = res.rows || [];
            }
          });
          resolve(res.rows || []);
        });
      },

      //广告位信息 - 常量；
      async getAdvertListFn() {
        return new Promise(async (resolve, reject) => {
          let res = await apiAdvertList({ projectKey: this.currentProjectKey, startDate: this.currentContractBeginDate, endDate: this.currentContractEndDate });
          Plan.ggwxxPlanFiledList.forEach(item => {
            if (item.bindFieldName == 'adKey') {
              item.optionList = res.rows || [];
            }
          });
          resolve(res.rows || []);
        });
      },

      //支出类合同的付费项 - 常量；
      async getChargeItemList() {
        let filedName = '';
        let incomeList = ['ZL', 'LSCD', 'WRSB', 'TCCYY', 'QTSR']; //收入类型合同的type值
        if (incomeList.indexOf(this.$route.query.contractType) > -1) {
          filedName = 'qtsrPayPlanFiledList';
        } else if (this.$route.query.contractType == 'GGZL') {
          filedName = 'ggwxxGatherFiledList';
        } else {
          filedName = 'zchtPlanFiledList';
        }
        return new Promise(async (resolve, reject) => {
          let res = await apiPaysonList({ contractType: this.contractType });
          Plan[filedName].forEach(item => {
            if (item.bindFieldName == 'chargeItemKey') {
              item.optionList = res.rows || [];
            }
            //广告租赁的费用项字段是：adKey
            if (item.bindFieldName == 'adKey') {
              item.optionList = res.rows || [];
            }
          });
          resolve(res.rows || []);
        });
      },

      //临时场地区域 - 常量；
      async getAreaListFn(spacePartitionKey) {
        return new Promise(async (resolve, reject) => {
          let res = await apiAreaList({ projectKey: this.currentProjectKey });
          Plan.lscdLeasePlanFiledList.forEach(item => {
            if (item.bindFieldName == 'rentArea') {
              item.optionList = res.rows || [];
            }
          });
          resolve(res.rows || []);
        });
      },

      //临时场地活动空间 - 常量；
      async getSpaceList(projectKey) {
        this.planTypeList[0].list.forEach(item => {
          let rentAreaValList = [];
          item.filedList.forEach(async (filed, filedIndex) => {
            if (filed.bindFieldName == 'venueKey') {
              let rentArea = this.getRentArea(item.filedList);
              filed.optionList = (await apiActivitySpaceList({ projectKey: projectKey, spacePartitionKey: rentArea })).rows || [];
            }
          });
        });
      },

      //获取临时场地活动空间接口的入参：区域
      getRentArea(list) {
        let val = '';
        list.forEach(item => {
          if (item.bindFieldName == 'rentArea') {
            val = item.bindFieldVal;
          }
        });
        return val;
      },
    },

    components: { formCommon },
  };
</script>
<style lang="scss" scoped>
  ::v-deep .el-input.is-disabled .el-input__inner {
    color: #333 !important;
  }
  .btn-box {
    width: 100%;
    .el-button {
      padding-bottom: 0;
    }
  }
  .bg-gray-input {
    ::v-deep .el-input__inner {
      background: #f4f4f4;
      border: unset;
      border-radius: unset;
      height: 32px !important;
      line-height: 32px;
      padding: 0 10px;
      font-size: 16px;
      color: #333;
      font-weight: 400;
    }
  }
  .border-bottom-thick-F2F2F2 {
    border-bottom: 10px solid #f2f2f2;
  }
</style>
